<?xml version="1.0" encoding="utf-8"?>

<!-- Part of Scheme 48 1.9.  See file COPYING for notices and license. -->

<!-- Authors: Mike Sperber -->

<!-- WiX 3.0 source file for building a Windows .msi installer for Scheme 48 -->

<!-- To build, fire up Cygwin, cd to the source directory, and do:
     build/generate-scheme48-files-wxi.sh ./scheme48vm -i scheme48.image
     candle build/scheme48.wxs
     light -ext WixUIExtension -cultures:en-us scheme48.wixobj
        [expect 2 "LGHT1076:ICE69" warnings]
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <!-- TODO:
     - user-definable location for shortcut
   -->
    <Product Id="5dc91c36-df2e-11d9-817f-00111175eb9e" Name="Scheme 48 1.9T" Version="1.9" Manufacturer="The Scheme 48 Maintainers, s48-info@s48.org" Codepage="1252" Language="1033" UpgradeCode="03640C67-8DAA-472d-A141-4DD75DD7B772">
        <Package Description="Scheme 48" Comments="Scheme 48 Development System" Manufacturer="The Scheme 48 Maintainers" InstallerVersion="110" Platform="x86" Languages="1033" Compressed="yes" />
        <Condition Message="This software only runs on Windows NT 4.0/2000/XP.">
      VersionNT
    </Condition>
        <Media Id="1" EmbedCab="yes" Cabinet="scheme48.cab" />
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder" Name="PFiles">
                <Directory Id="Scheme48" Name="Scheme 48">
                    <Directory Id="INSTALLDIR" Name="Scheme 48 1.9T">
                        <Component Id="Main" Guid="74a1362f-df2e-11d9-817f-00111175eb9e">
                            <File Id="Scheme48VM" Name="scheme48vm.exe" DiskId="1" Source="scheme48vm.exe" Vital="yes" />
                            <File Id="Scheme48VM.lib" Name="scheme48vm.lib" DiskId="1" Source="scheme48vm.lib" Vital="yes" />
                            <File Id="COPYING" Name="COPYING" DiskId="1" Source="COPYING" Vital="yes" />
                            <!-- install null files to make sure the generated files get uninstalled again -->
                            <File Id="Scheme48Image" Name="scheme48.image" Source="build/dummy" DiskId="1" Vital="yes" />
                            <File Id="Scheme48BAT" Name="scheme48.bat" Source="build/dummy" DiskId="1" Vital="yes" />
                        </Component>
                        <?include scheme48-files.wxi ?>
                        <Directory Id="include" Name="include">
                            <Component Id="include_component" Guid="78c33182-df2e-11d9-817f-00111175eb9e">
                                <File Id="include_scheme48.h" Name="scheme48.h" Source="c/scheme48.h" DiskId="1" Vital="yes" />
                                <File Id="include_scheme48write_barrier.h" Name="scheme48write-barrier.h" Source="c/scheme48write-barrier.h" DiskId="1" Vital="yes" />
                                <File Id="include_scheme48arch.h" Name="scheme48arch.h" Source="c/win32/scheme48arch.h" DiskId="1" Vital="yes" />
                            </Component>
                        </Directory>
                        <Directory Id="external" Name="external">
                            <Component Id="external_component" Guid="CAAA27A9-D56B-4EE3-AF02-02227F020C75">
                                <File Id="external_srfi_27.dll" Name="srfi-27.dll" Source="srfi-27.dll" DiskId="1" Vital="yes" />
                                <File Id="external_r6rs.dll" Name="r6rs.dll" Source="r6rs.dll" DiskId="1" Vital="yes" />
                            </Component>
                        </Directory>
                        <Directory Id="build" Name="build">
                            <Component Id="build_component" Guid="7d78a564-df2e-11d9-817f-00111175eb9e">
                                <File Id="build_initial.image" Name="initial.image-32" DiskId="1" Source="build/initial.image-32" Vital="yes" />
                                <File Id="build_initial.debug" Name="initial.debug" DiskId="1" Source="build/initial.debug" Vital="yes" />
                                <File Id="build_initial.scm" Name="initial.scm" DiskId="1" Source="build/initial.scm" Vital="yes" />
                                <File Id="build_build_usual_image.bat" Name="build-usual-image.bat" Source="build/build-usual-image.bat" DiskId="1" Vital="yes" />
                                <!--- install a null file so it will be deleted again by rollback and uninstall -->
                                <File Id="build_usual_image.input" Name="build-usual-image.input" Source="build/dummy" DiskId="1" Vital="yes" />
                                <File Id="generate_go.bat" Name="generate-go.bat" Source="build/generate-go.bat" DiskId="1" Vital="yes" />
                            </Component>
                        </Directory>
                    </Directory>
                </Directory>
            </Directory>
            <Directory Id="ProgramMenuFolder" Name="Programs">
                <Directory Id="ProgramMenuDir" Name="Scheme 48" />
            </Directory>
            <Directory Id="DesktopFolder" Name="Desktop" />
        </Directory>
	<DirectoryRef Id="ProgramMenuDir">
	    <Component Id="short_cut_component" Guid="4C17374F-37C7-4a09-A7E1-15BAD7CE7120">
	        <Shortcut Id="start_menu_entry" Directory="ProgramMenuDir" Description="Scheme 48 Console" Name="Scheme 48 1.9T" Target="[INSTALLDIR]scheme48" WorkingDirectory="INSTALLDIR" Icon="scheme48.ico" IconIndex="0" Show="normal" />
                <Shortcut Id="doc_html_menu_entry" Directory="ProgramMenuDir" Description="Scheme 48 HTML Documentation" Name="Scheme 48 1.9T HTML Documentation" Target="[#doc_html_manual.html]" Show="normal" />
                <Shortcut Id="doc_pdf_menu_entry" Directory="ProgramMenuDir" Description="Scheme 48 PDF Documentation" Name="Scheme 48 1.9T PDF Documentation" Target="[#doc_manual.pdf]" Show="normal" />
	        <RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
   	        <RegistryValue Root="HKCU" Key="Software\Scheme 48\Scheme 48 1.9T" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
	    </Component>
	</DirectoryRef>
	
        <!-- declare building of scheme48.image -->
        <!-- /v:off needed to avoid mangling !s on some systems -->
        <CustomAction Id="build_usual_image" Directory="INSTALLDIR" ExeCommand="[SystemFolder]cmd.exe /v:off /c build\build-usual-image.bat &quot;[INSTALLDIR]&quot; &quot;[INSTALLDIR]scheme&quot; &quot;[INSTALLDIR]external&quot; &quot;[INSTALLDIR]scheme48.image&quot; &quot;[INSTALLDIR]scheme48vm.exe&quot; &quot;[INSTALLDIR]build\initial.image-32&quot;" Execute="deferred" Impersonate="no" Return="check" />
        <!-- declare generation of front end -->
        <CustomAction Id="generate_go" FileKey="generate_go.bat" ExeCommand="&quot;[INSTALLDIR]scheme48.bat&quot; &quot;[INSTALLDIR]scheme48vm.exe&quot; &quot;[INSTALLDIR]scheme48.image&quot;" Execute="deferred" Impersonate="no" Return="check" />
        <Icon Id="scheme48.ico" SourceFile="build/scheme48.ico" />
        <Feature Id="Complete" Level="1" Title="Scheme 48 1.9T" Description="Scheme 48 1.9T main installation" ConfigurableDirectory="INSTALLDIR">
            <ComponentRef Id="Main" />
            <ComponentRef Id="include_component" />
            <ComponentRef Id="build_component" />
            <ComponentRef Id="scheme_component" />
            <ComponentRef Id="scheme_env_component" />
            <ComponentRef Id="scheme_big_component" />
            <ComponentRef Id="scheme_sort_component" />
            <ComponentRef Id="scheme_misc_component" />
            <ComponentRef Id="scheme_cml_component" />
            <ComponentRef Id="scheme_srfi_component" />
            <ComponentRef Id="scheme_rts_component" />
            <ComponentRef Id="scheme_r6rs_component" />
            <ComponentRef Id="scheme_net_component" />
            <ComponentRef Id="scheme_posix_component" />
            <ComponentRef Id="external_component" />
            <ComponentRef Id="doc_component" />
            <ComponentRef Id="doc_html_component" />
	    <ComponentRef Id="short_cut_component" />
        </Feature>
        <!-- schedule the building of scheme48.image -->
        <InstallExecuteSequence>
            <Custom Action="build_usual_image" Before="InstallFinalize"><![CDATA[(NOT Installed) OR (INSTALLMODE = "Repair")]]></Custom>
            <Custom Action="generate_go" Before="InstallFinalize"><![CDATA[(NOT Installed) OR (INSTALLMODE = "Repair")]]></Custom>
        </InstallExecuteSequence>
	<WixVariable Id="WixUILicenseRtf" Value="COPYING.rtf" />
	<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
	<Property Id="ARPPRODUCTICON" Value="scheme48.ico" />
	<UIRef Id="WixUI_InstallDir" />
    </Product>
</Wix>
